package com.liuf.es.domain;


import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * 索引名称必须全部小写
 * @author LIUFANG
 */

// 索引名称 类型 分区 备份 刷新
@Document(indexName = "article_index",type = "article",shards = 5,replicas = 1,refreshInterval = "-1",indexStoreType = "fs")
@Data
public class Article implements Serializable {

    @Id
    private Long id;
    /**标题*/
    /**String 字段默认添加分词器
     *
     * 同时可以指定分词组件
     */
    private String title;
    /**摘要*/
    private String abstracts;
    /**内容*/
    private String content;
    /**发表时间*/
    @Field(format= DateFormat.date_time,index=false,store=true,type= FieldType.Object)
    private Date postTime;
    /**点击率*/
    private Long clickCount;
}
